home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / mac / media / dirs / BackUp / Internet.dir / 00006_Script_Button BehaviorButton Behavior__.ls < prev    next >
Text File  |  2001-12-03  |  3KB  |  73 lines

  1. --This behavior flashes a member at a desired rate and also allows it to work as a link to another frame.
  2. --PROPERTIES--
  3. --Hot: The member switched to (hot state).
  4. --FlashSpeed: The speed in which the sprite flashes measured in ticks (1/60th of a sec.)
  5. --WhichFrame: The frame junped to if pushed. Zero keeps the current frame.
  6. --Glowing: Lets the function know if the sprite is hot or cold.
  7. --RollOvr: The member switched to when rolled-over.
  8. --ButtonSound: The sound that will play when clicked. Channel 2 is reserved for short sounds.
  9. --TimeTracker: Times out the seconds between flashes.
  10. --SpNum: The sprite number of the sprite.
  11. --MyNum: The Member's number
  12.  
  13. property MyColor, OrigColor, WhichFrame, RollOvr, AssocImage, ButtonSound, MovieControl, TimeTracker, SpNum, MyNum, webaddress
  14.  
  15. --Captures the spritenumber.
  16. on new me
  17.   SpNum = me.spritenum
  18.   MyNum=sprite(SpNum).member.number
  19.   OrigColor = member(MyNum).forecolor
  20. end
  21.  
  22. --Creates the dialog box for the behavior.
  23. on getpropertydescriptionlist me
  24.   set pList = [#MyColor:[#comment: "Which color would you like to use for the RollOver?", #format: #integer, #range: [#min: 0, #max: 255], #default: 192], \
  25.  #RollOvr: [#comment: "Which member would you like to use for the rollover?", #format: #string, #default: ""], \
  26.  #AssocImage: [#Comment: "Which image is this member associated with?", #format: #string, #default: ""],\
  27.  #ButtonSound:[#comment: "What sound would you like to play when the button is pressed?",#format:#string,#default:"Click"],\
  28.  #MovieControl: [#comment: "Is this button used to control a movie?",#format: #string,#range: ["Play", "Pause","Stop","Rewind","Fast Forward", "No"],#default:"No"], \
  29.  #WebAddress: [#Comment: "What address would you like the graphic to link to?", #format: #string, #default: ""],\
  30.   #WhichFrame: [#comment: "Which frame would you like to jump to?", #format:#integer, default: "0"]]
  31.   return plist
  32. end
  33.  
  34. --This is for the rollover.
  35. on mouseenter me
  36.   if rollovr <> "" then
  37.     sprite(SpNum).membernum = member(RollOvr).number
  38.   end if
  39.   if AssocImage <> "" then
  40.     sendallsprites(#imagechange, AssocImage)
  41.   end if
  42.   member(MyNum).forecolor = MyColor
  43.   sprite(SpNum).cursor = 280  
  44.   updateStage  
  45. end
  46. on mouseleave me
  47.   if rollovr <> "" then
  48.     sprite(SpNum).membernum = member(MyNum).number
  49.   end if
  50.   member(MyNum).forecolor = OrigColor
  51.   sprite(SpNum).cursor = 293 
  52.   --  Glowing = 0
  53.   updateStage
  54. end
  55.  
  56. --This goes to another frame and tells the movie what to do. Also plays the sound, if any.
  57. on mousedown me
  58.   if WhichFrame <> 0 then
  59.     go to frame WhichFrame
  60.   else if MovieControl <> "No" then
  61.     sendallsprites (#MovieActionDown, MovieControl)  
  62.   end if
  63.   if webaddress <> "" then
  64.     gotoNetPage WebAddress
  65.   end if
  66.   if  ButtonSound <> "" then
  67.     sound(2).play(member(ButtonSound)) 
  68.   end if
  69.   updatestage
  70. end
  71.  
  72.  
  73.